<template>
  <div class="bg-grey h-full">
    <van-nav-bar title="投保记录" left-arrow @click-left="$router.push('/user')" />
    <van-skeleton :row="5" :loading="!ready" class="m-t-20">
      <div v-if="list.length">
        <van-cell-group class="m-t-10" v-for="item in list" :key="item.id">
          <van-cell title="保险公司" :value="item.bxgs" />
          <van-cell title="保险起期" :value="item.bxqq" />
          <van-cell title="保险起期" :value="item.bxzq" />
        </van-cell-group>
      </div>
      <empty-data v-else class="text-center m-t-50" content="暂无投保记录"></empty-data>
    </van-skeleton>
  </div>
</template>

<script>
export default {
  data () {
    return {
      ready: false,
      list: []
    }
  },
  mounted () {
    this.init()
  },
  methods: {
    init () {
      this.getRecordList()
    },
    async getRecordList () {
      let { vipTbList } = await this.$api.post('/tb/query', {})
      this.list = vipTbList
      this.ready = true
    }
  }
}
</script>
